import { BasicsEntity } from 'src/common/entities/common.entity';
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
import { DictType } from '../../dict-type/entities/dict-type.entity';

@Entity({ name: 'sys_dict_item' })
export class DictItem extends BasicsEntity {
  @Column({ comment: '字典名称' })
  label: string;

  @Column({ comment: '字典值' })
  value: string;

  @Column({ comment: '状态', type: 'tinyint', default: 1 })
  status: number;

  @Column({ comment: '备注' })
  remark: string;

  @ManyToOne(() => DictType, (dictType) => dictType.id, { cascade: true })
  @JoinColumn({ name: 'dict_id' })
  dictType: DictType;
}
